﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Xml;
using System.Xml.Xsl;

namespace Quocity.ImportData
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                RecuperarDatosPamplona();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
            Console.ReadLine();
        }
        static void RecuperarDatosPamplona(){
            es.navarra.administracionelectronica.Service4ASoapClient service = new es.navarra.administracionelectronica.Service4ASoapClient();
            DataSet dataSet = service.getDataSet();

            XmlDataDocument xmlDataDocument = new XmlDataDocument(dataSet);

            XslCompiledTransform myXslTransform;
            myXslTransform = new XslCompiledTransform();
            myXslTransform.Load(@"Xsl\Pamplona.xsl");

            XmlTextWriter xmlWriter = new XmlTextWriter("output/pamplona.xml", Encoding.UTF8);
            
            myXslTransform.Transform(xmlDataDocument, new XsltArgumentList(), xmlWriter);
            

        }


    }
}
